package com.example.tangjiangxu.bitmapdemo;

import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;

public class MainActivity extends Activity {
    private static final String TAG = "MainActivity";

    @TargetApi(Build.VERSION_CODES.KITKAT)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.timg);

        ImageView img = (ImageView) findViewById(R.id.img1);
        ImageLoader.loadImage(this, img, R.mipmap.timg, 100, 100);
        //Log.e(TAG, "onCreate: bitmap1.size:" + (bitmap.getAllocationByteCount() * 1.0 / 1024 / 1024) + "Mb");
        ImageView img2 = (ImageView) findViewById(R.id.img2);
        ImageLoader.loadImage(this, img2, R.mipmap.timg, 100, 100);
        //Log.e(TAG, "onCreate: bitmap2.size:" + (bitmap2.getRowBytes() * bitmap2.getHeight()* 1.0 / 1024 / 1024) + "Mb" + ",bitmap.w:" + bitmap2.getWidth() + ",bitmap.h:" + bitmap2.getHeight());
    }
}
